package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 分班参数配置表
 *
 * @author chenzh
 * @since 2023-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_class_setting")
@Schema(name = "EduClassSetting", title = "分班参数配置表", description = "分班参数配置表实体类")
public class EduClassSetting extends Model<EduClassSetting> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "classParamId", description = "分班设置id")
    @TableId(value = "class_param_id", type = IdType.ASSIGN_ID)
    private Long classParamId;

    @Schema(name = "year", description = "年份")
    @TableField(value = "year", updateStrategy = FieldStrategy.NOT_NULL)
    private Integer year;

    @Schema(name = "areaCode", description = "行政区划")
    @TableField(value = "area_code", updateStrategy = FieldStrategy.NOT_NULL)
    private String areaCode;

    @Schema(name = "classNum", description = "班级数")
    @TableField(value = "class_num")
    private Integer classNum;

    @Schema(name = "schoolId", description = "规则所属学校")
    @TableField(value = "school_id")
    private String schoolId;

    @Schema(name = "enabled", description = "是否启用：0 否 1 是")
    @TableField(value = "enabled", updateStrategy = FieldStrategy.NOT_NULL)
    private String enabled;
    @Schema(name = "configTypeName", description = "招生计划类别")
    @TableField(value = "config_type_name")
    private String configTypeName;
    @Schema(name = "classParams", description = "分班规则参数")
    @TableField(value = "class_params")
    private String classParams;

    @Schema(name = "createName", description = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", description = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(name = "del", description = "逻辑删除标志")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Override
    public Serializable pkVal() {
        return this.classParamId;
    }
}
